package vehicle_maintain_enum

import "gitee.com/lailonghui/vehicle-supervision-framework/pkg/dicts"

// 车辆维护-sim卡类型
type vehicleMaintainSimType int

var VehicleMaintainSimType vehicleMaintainSimType

// 10元
func (c *vehicleMaintainSimType) TenYuan() int {
	return 1
}

// 20元
func (c *vehicleMaintainSimType) TwentyYuan() int {
	return 2
}

// 70元
func (c *vehicleMaintainSimType) SeventyYuan() int {
	return 3
}

// 车主自购卡
func (c *vehicleMaintainSimType) CustomerSelf() int {
	return 4
}

func (c *vehicleMaintainSimType) ToText(value int) string {
	switch value {

	case 1:
		return "10元"

	case 2:
		return "20元"

	case 3:
		return "70元"

	case 4:
		return "车主自购卡"

	}
	return ""
}

func (c *vehicleMaintainSimType) ToDict(value int) *dicts.IntDict {
	return &dicts.IntDict{
		Text:  c.ToText(value),
		Value: value,
	}
}

func (c *vehicleMaintainSimType) ToValue(text string) int {
	switch text {

	case "10元":
		return 1

	case "20元":
		return 2

	case "70元":
		return 3

	case "车主自购卡":
		return 4

	}
	return 0
}
